<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button onclick="f1()">按钮1</button>
    <button onclick="console.log(this);">按钮2</button>
    <button onclick="f2(this)">按钮3</button>
    <hr>
    <button id="btn4">按钮4</button>
    <hr>
    <h1 id="hlm">红楼梦</h1>
    <script>
        function f1(){
            console.log(this);//window
        }
        function f2(that){
            console.log(that);
        }

        btn4.onclick=function(e){
            console.log(this);
            console.log(this===e.target);
        }
        console.log('====');
        var dog = {
            name:"拉布拉多",
            say:()=>{
                console.log(this);
            }
        }
        dog.say();

        hlm.onclick = ()=>{
            hlm.className="a b m";
        }
    </script>
</body>
</html>